import request from "@/utils/request";

// 查询券码管理列表
export function listCoupon(query) {
  return request({
    url: "/cancel/coupon/list",
    method: "get",
    params: query,
  });
}

// 查询券码管理详细
export function getCoupon(id) {
  return request({
    url: "/cancel/coupon/" + id,
    method: "get",
  });
}

// 新增券码管理
export function addCoupon(data) {
  return request({
    url: "/cancel/coupon",
    method: "post",
    data: data,
  });
}

// 修改券码管理
export function updateCoupon(data) {
  return request({
    url: "/cancel/coupon",
    method: "put",
    data: data,
  });
}

// 删除券码管理
export function delCoupon(id) {
  return request({
    url: "/cancel/coupon/" + id,
    method: "delete",
  });
}
//生成券码
export function genCode(data) {
  return request({
    url: "/cancel/couponCode/genCode",
    method: "post",
    data: data,
  });
}
//激活券码
export function jhCoupon(data) {
  return request({
    url: "/cancel/couponCode/jhCoupon",
    method: "post",
    data: data,
  });
}
//关联商品
export function setCouponGoods(data) {
  return request({
    url: "/cancel/coupon/setCouponGoods",
    method: "post",
    data: data,
  });
}
//查询已关联的商品
export function goodsListInfo(data) {
  return request({
    url: "/cancel/coupon/showCouponProduct",
    method: "post",
    data: data,
  });
}
//关联商品列表
export function showProductVirList() {
  return request({
    url: "/commodity/product/showProductVirList",
    method: "get",
  });
}

// 关联商户列表
export function showShoperList() {
  return request({
    url: "/cancel/shoper/parentList",
    method: "get",
  });
}
// 批量延期
export function setOutTime(data) {
  return request({
    url: "/cancel/coupon/setOutTime",
    method: "post",
    data: data,
  });
}
//获取客户下的商城列表
export function getCustomerShopList(query) {
  return request({
    url: "/mall/getCustomerShopList",
    method: "get",
    params: query,
  });
}
